Optimal. Leaf size=33 \[ -2 a A x-\frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {21, 3873, 8,
4130, 3855} \begin {gather*} -\frac {a A \cos (c+d x)}{d}-\frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-2 a A x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 21
Rule 3855
Rule 3873
Rule 4130
Rubi steps
\begin {align*} \int (a-a \csc (c+d x)) (A-A \csc (c+d x)) \sin (c+d x) \, dx &=\frac {A \int (a-a \csc (c+d x))^2 \sin (c+d x) \, dx}{a}\\ &=\frac {A \int \left (a^2+a^2 \csc ^2(c+d x)\right ) \sin (c+d x) \, dx}{a}-(2 a A) \int 1 \, dx\\ &=-2 a A x-\frac {a A \cos (c+d x)}{d}+(a A) \int \csc (c+d x) \, dx\\ &=-2 a A x-\frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(72\) vs. \(2(33)=66\).
time = 0.03, size = 72, normalized size = 2.18 \begin {gather*} -2 a A x-\frac {a A \cos (c) \cos (d x)}{d}-\frac {a A \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {a A \log \left (\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {a A \sin (c) \sin (d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 44, normalized size = 1.33
method | result | size |
derivativedivides | \(\frac {A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-2 A a \left (d x +c \right )-A a \cos \left (d x +c \right )}{d}\) | \(44\) |
default | \(\frac {A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-2 A a \left (d x +c \right )-A a \cos \left (d x +c \right )}{d}\) | \(44\) |
risch | \(-2 a A x -\frac {A a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {A a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(76\) |
norman | \(\frac {\frac {2 A a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-2 a A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a A x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {A a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(94\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 41, normalized size = 1.24 \begin {gather*} -\frac {2 \, {\left (d x + c\right )} A a + A a \cos \left (d x + c\right ) + A a \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.03, size = 51, normalized size = 1.55 \begin {gather*} -\frac {4 \, A a d x + 2 \, A a \cos \left (d x + c\right ) + A a \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - A a \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 7.37, size = 82, normalized size = 2.48 \begin {gather*} - 2 A a x + A a \left (\begin {cases} - \frac {\cot {\left (c + d x \right )}}{d \csc {\left (c + d x \right )}} & \text {for}\: d \neq 0 \\\frac {x}{\csc {\left (c \right )}} & \text {otherwise} \end {cases}\right ) + A a \left (\begin {cases} \frac {x \cot {\left (c \right )} \csc {\left (c \right )}}{\cot {\left (c \right )} + \csc {\left (c \right )}} + \frac {x \csc ^{2}{\left (c \right )}}{\cot {\left (c \right )} + \csc {\left (c \right )}} & \text {for}\: d = 0 \\- \frac {\log {\left (\cot {\left (c + d x \right )} + \csc {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 49, normalized size = 1.48 \begin {gather*} -\frac {2 \, {\left (d x + c\right )} A a - A a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {2 \, A a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.29, size = 129, normalized size = 3.91 \begin {gather*} \frac {A\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {2\,A\,a}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {4\,A\,a\,\mathrm {atan}\left (\frac {16\,A^2\,a^2}{8\,A^2\,a^2+16\,A^2\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-\frac {8\,A^2\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,A^2\,a^2+16\,A^2\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________